package com.hjqjl.common_lib.utils;

public class ButtonUtils {
	private static long lastClickTime;

	/**
	 * 防止按钮快速点击
	 * 用法
	 * public void onClick(View v) {
	    	if (ButtonUtils.isFastClick(2000)) {
	        	return ;
	    	}
		}
	 * intervalTime单位是ms
	 */
	public synchronized static boolean isFastClick(int intervalTime) {
		long time = System.currentTimeMillis();
		if (time - lastClickTime < intervalTime) {
			return true;
		}
		lastClickTime = time;
		return false;
	}
}
